<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>
    <style>
        *{padding: 0;margin: 0;}
        a{
            color: inherit;
            text-decoration: none;
        }
        li{
            list-style: none;
        }
        .container{
            width: 600px;
            margin: 0 auto;
        }
        .container .nav{
            height: 45px;
            line-height: 45px;
            text-align: center;
            display: flex;
        }
        .container .nav li{
            flex:1;
            border: 1px solid #333;
        }
        .container .nav li + li{
            border-left: 0;
        }
        .container .nav .active{
            background-color: pink;
            color: #fff;
        }
        .part{
            width: 100%;
        }

        .part .partItem{
            height: 400px;
            border: 1px solid #333;
            border-top: 0;
            box-sizing: border-box;
            text-align: center;
            line-height: 400px;
        }
    </style>
</head>
<body>
    <div id="app">
        <div class="container">
            <!-- ul.nav>li*6{nav_$$} -->
            <ul class="nav">
                <!-- <li :class="{active:activeIndex==0}" @click="activeIndex=0">nav_01</li>
                <li :class="{active:activeIndex==1}" @click="activeIndex=1">nav_02</li>
                <li :class="{active:activeIndex==2}" @click="activeIndex=2">nav_03</li>
                <li :class="{active:activeIndex==3}" @click="activeIndex=3">nav_04</li>
                <li :class="{active:activeIndex==4}" @click="activeIndex=4">nav_05</li>
                <li :class="{active:activeIndex==5}" @click="activeIndex=5">nav_06</li> -->

                <li 
                    v-for="(item,index) in navList" 
                    :key="index"  
                    :class="{active:activeIndex == index}" 
                    @click="activeIndex = index">
                    <span :href="item.link">{{item.label}}</span>
                </li>
            </ul>
            <div class="part">
                <!-- .partItem*6{part_$$} -->
                <!-- <div class="partItem">part_01</div>
                <div class="partItem">part_02</div>
                <div class="partItem">part_03</div>
                <div class="partItem">part_04</div>
                <div class="partItem">part_05</div>
                <div class="partItem">part_06</div> -->

                <div class="partItem" v-for="(n,i) in 6" :key="i" v-show="activeIndex==i">{{n}}</div>

            </div>
        </div>
    </div>
</body>
<script>
    var vm = new Vue({
        el:"#app",
        data:{
            activeIndex:0,
            navList:[
                {label:"番剧",link:"https://www.baidu.com"},
                {label:"国创",link:"https://www.baidu.com"},
                {label:"舞蹈",link:"https://www.baidu.com"},
                {label:"动画",link:"https://www.baidu.com"},
                {label:"综艺",link:"https://www.baidu.com"},
                {label:"鬼畜",link:"https://www.baidu.com"},
            ]
        }
    })

</script>
</html>